<%@ page contentType="text/html; charset=utf-8" language="java" errorPage="" %>
<%@ page import="javax.naming.Context"%> 
<%@ page import="javax.sql.DataSource"%> 
<%@ page import="javax.naming.InitialContext"%> 
<%@ page import="java.sql.*"%> 
<html> 
<body> 
<%
Context ctx = new InitialContext();
DataSource ds = (DataSource)ctx.lookup("java:comp/env/jdbc/gc");
Connection conn = ds.getConnection();
Statement stmt=conn.createStatement(ResultSet.TYPE_SCROLL_SENSITIVE,ResultSet.CONCUR_UPDATABLE); 
String sql="select * from rss"; 
ResultSet rs=stmt.executeQuery(sql); 
while(rs.next()) {%> 
您的第一个字段内容为：<%=rs.getString(1)%> <br>
<%}%> 
<%out.print("数据库操作成功，恭喜你");%> 
<%rs.close(); 
stmt.close(); 
conn.close();   
%> 